from sklearn.externals import joblib
from sklearn.neighbors import KNeighborsClassifier

knn=joblib.load('knn_predict.pkl')
#AQI指数，PM2.5，PM10，CO，NO2，SO2，O3  爬取顺序

#AQI	PM2.5	PM10	SO2	CO	NO2	O3_8h 需要顺序
l = [59, 37, 66, 0.6, 20, 6, 47]
t = l[5]
l[5] = l[4]
l[4] = l[3]
l[3] = t
print(l)
print(knn.predict([l]))

def get_preknn(l):
    t = l[5]
    l[5] = l[4]
    l[4] = l[3]
    l[3] = t
    # print(l)
    # print(knn.predict([l]))
    return knn.predict([l])